package validate

import (
	"github.com/go-playground/validator/v10"
	"regexp"
)

func PhoneValidate(field validator.FieldLevel) bool {
	phone := field.Field().String()
	matched, _ := regexp.Match("^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", []byte(phone))
	return matched
}
